package com.oceanread.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oceanread.cn.entity.Drillhole1;
import com.oceanread.cn.mapper.Drillhole1Mapper;
import com.oceanread.cn.service.IDrillhole1Service;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IDrillhole1ServiceImpl extends ServiceImpl<Drillhole1Mapper, Drillhole1> implements IDrillhole1Service {
    @Override
    public List<Drillhole1> getall() {
        return baseMapper.getall();
    }

    @Override
    public List<Drillhole1> getPrj(String prjCode, int page, int size) {
        return baseMapper.getPrj(prjCode, (page - 1) * size, size);
    }

    @Override
    public Integer getPrjnum(String prjCode) {
        return baseMapper.getPrjnum(prjCode);
    }

    @Override
    public Integer getnumquery(String key, String value) {
        return baseMapper.getnumquery(key, value);
    }

    @Override
    public Integer update(Drillhole1 drillhole1) {
        baseMapper.update(drillhole1.getId(), drillhole1.getPrjCode(), drillhole1.getCode(), drillhole1.getName(),
                drillhole1.getPrjID(), drillhole1.getType(), drillhole1.getEquipment(), drillhole1.getLat(),
                drillhole1.getLon(), drillhole1.getEast(), drillhole1.getNorth(), drillhole1.getSampling(),
                drillhole1.getResponsible(), drillhole1.getDrawing(), drillhole1.getProofreading(), drillhole1.getCatalog(),
                drillhole1.getTime(), drillhole1.getDiameter(), drillhole1.getAltitude(), drillhole1.getStart(),
                drillhole1.getThickness(), drillhole1.getMaterial(), drillhole1.getMaterial0()
        );
        return 0;
    }

    public List<Drillhole1> query(String key, String value) {
        return baseMapper.query(key, value);
    }

    public List<Drillhole1> query1(String key, String value, int page, int size) {
        return baseMapper.query1((page - 1) * size, size, key, value);
    }

    @Override
    public int delete(int id) {
        return baseMapper.delete(id);
    }

    @Override
    public int insert(String PrjCode, String Code, String Name, String PrjID,
                      String Type, String Equipment, String Lat, String Lon,
                      String East, String North, String Sampling, String Responsible,
                      String Drawing, String Proofreading, String Catalog, String Time,
                      String Diameter, String Altitude, String Start, String Thickness,
                      String Material, String Material0) {
        return baseMapper.insert(PrjCode, Code, Name, PrjID, Type, Equipment, Lat, Lon, East,
                North, Sampling, Responsible, Drawing, Proofreading, Catalog, Time,
                Diameter, Altitude, Start, Thickness, Material, Material0);
    }

    ;
}
